#include "GY_GraphicsArcItem.h"
#include <QPen>
#include <QPainter>
#include <QtMath>
#include <QDebug>

GY_GraphicsArcItem::GY_GraphicsArcItem(const QString &guid, QGraphicsItem *parent)
    :GY_BasicsGraphicsObject(guid,this,parent)
{
    //图元类型
    GY_Object::setUserData(GY_ENUM::ClassType,QVariant("Arc"));
    initializationPropertyInfo();
    updataPen();
    updataBrush();
    updateDraw();
    QMap<QVariant,QPointF> editPoints = {
        {"RadiusPoint1",m_PropertyInfoMap["RadiusPoint1"].propertyValue.toPointF()},
        {"RadiusPoint2",m_PropertyInfoMap["RadiusPoint2"].propertyValue.toPointF()}
    };
    this->setPen(QColor(Qt::green));
    this->setEditPointF(editPoints);
    this->setCenterPointF(m_PropertyInfoMap["Center"].propertyValue.toPointF());
    //!收到信号表示isOpen发生改变，需要更新重绘
    connect(this, &GY_BasicsGraphicsObject::updateDrawSig,this,&GY_GraphicsArcItem::updateDraw);
}

GY_GraphicsArcItem::GY_GraphicsArcItem(const QString &guid, const QPointF &position, const qreal &startAngele,
                                       const qreal &sweptAngele, const qreal &Raduis, QGraphicsItem *parent)
    :GY_BasicsGraphicsObject(guid,this,parent)
{
    //图元类型
    GY_Object::setUserData(GY_ENUM::ClassType,QVariant("Arc"));
    initializationPropertyInfo();
    updataPen();
    updataBrush();
    m_PropertyInfoMap["Center"].propertyValue=position;
    m_PropertyInfoMap["StartAngle"].propertyValue=startAngele;
    m_PropertyInfoMap["SweptAngle"].propertyValue=sweptAngele;
    m_PropertyInfoMap["Radius"].propertyValue=Raduis;
    updateDraw();
    calculateRadiusPoint2Position();
    calculateRadiusPoint1Position();
    this->setCenterPointF(m_PropertyInfoMap["Center"].propertyValue.toPointF());
    connect(this, &GY_BasicsGraphicsObject::updateDrawSig,this,&GY_GraphicsArcItem::updateDraw);
}

void GY_GraphicsArcItem::initializationPropertyInfo()
{
    /*
     *LineStyle属性的数据
     * QVector<qreal>中index(0)是Qt::PenCapStyle、Qt::PenJoinStyle与Qt::PenStyle的组合,index(1)为线条粗细，之后是自定义钢笔样式的数据 */
    QVector<qreal> varStyle;
    int style = Qt::SquareCap|Qt::BevelJoin|Qt::CustomDashLine;
    varStyle<<style<<2<<3<<2<<4<<5<<6<<7;

    int gradientSpread = QGradient::PadSpread;//指定如何填充渐变之外的区域
    QColor colorStart = QColor(0,255,0);//开始颜色
    QColor colorStop = QColor(0,0,255);//结束颜色
    int gradientType = QGradient::LinearGradient;//指定渐变的类型
    QPointF pointFStart = QPointF(0,0);//开始的坐标或中心点坐标
    QPointF pointFStop = QPointF(1,1);//结束的坐标或径向梯度的焦点坐标
    qreal centerRadius = 100;//中心半径
    qreal focalRadius = 100;//径向梯度的焦点半径
    QVector<qreal> varGradientStyle;
    varGradientStyle<<gradientSpread<<colorStart.rgb()<<colorStop.rgb()<<gradientType<<pointFStart.x()
                   <<pointFStart.y()<<pointFStop.x()<<pointFStop.y()<<centerRadius<<focalRadius;

    //位置
    GY_PropertyInfo positonPropertyInfo(this);
    positonPropertyInfo.propertyName="Center";
    positonPropertyInfo.propertyValue=QPointF(0,0);
    positonPropertyInfo.updateType = Update|MoveUpdate|PointOfRelative;
    positonPropertyInfo.propertyType = PointPropertyType;
    positonPropertyInfo.updatePropertyFun=(GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateCirlePoint;
    m_PropertyInfoMap.insert(positonPropertyInfo.propertyName,positonPropertyInfo);
    m_PropertyInfoMap[positonPropertyInfo.propertyName].setConnect();

    //开始角度
    GY_PropertyInfo startAnglePropertyInfo(this);
    startAnglePropertyInfo.propertyName="StartAngle";
    startAnglePropertyInfo.propertyValue=0.0;
    startAnglePropertyInfo.updateType = Update|OrdinaryAttributes;
    startAnglePropertyInfo.propertyType = DoublePropertyType;
    startAnglePropertyInfo.updatePropertyFun=(GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateStartAngle;
    m_PropertyInfoMap.insert(startAnglePropertyInfo.propertyName,startAnglePropertyInfo);
    m_PropertyInfoMap[startAnglePropertyInfo.propertyName].setConnect();

    //经过角度
    GY_PropertyInfo SweptAnglePropertyInfo(this);
    SweptAnglePropertyInfo.propertyName="SweptAngle";
    SweptAnglePropertyInfo.propertyValue=90.0;
    SweptAnglePropertyInfo.updateType = Update|OrdinaryAttributes;
    SweptAnglePropertyInfo.propertyType = DoublePropertyType;
    SweptAnglePropertyInfo.updatePropertyFun=(GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateSweptAngele;
    m_PropertyInfoMap.insert(SweptAnglePropertyInfo.propertyName,SweptAnglePropertyInfo);
    m_PropertyInfoMap[SweptAnglePropertyInfo.propertyName].setConnect();

    //半径
    GY_PropertyInfo RadiusPropertyInfo(this);
    RadiusPropertyInfo.propertyName="Radius";
    RadiusPropertyInfo.propertyValue=100.0;
    RadiusPropertyInfo.updateType = Update|OrdinaryAttributes;
    RadiusPropertyInfo.propertyType = DoublePropertyType;
    RadiusPropertyInfo.updatePropertyFun=(GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateRadius;
    m_PropertyInfoMap.insert(RadiusPropertyInfo.propertyName,RadiusPropertyInfo);
    m_PropertyInfoMap[RadiusPropertyInfo.propertyName].setConnect();

    //半径点1
    GY_PropertyInfo RadiusPoint1PropertyInfo(this);
    RadiusPoint1PropertyInfo.propertyName="RadiusPoint1";
    RadiusPoint1PropertyInfo.propertyValue=QPointF(100,0);
    RadiusPoint1PropertyInfo.propertyType = PointPropertyType;
    RadiusPoint1PropertyInfo.updateType = NotUpdate;
    RadiusPoint1PropertyInfo.updatePropertyFun=(GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateRadiusPoint1;
    m_PropertyInfoMap.insert(RadiusPoint1PropertyInfo.propertyName,RadiusPoint1PropertyInfo);
    m_PropertyInfoMap[RadiusPoint1PropertyInfo.propertyName].setConnect();
    //半径点2
    GY_PropertyInfo RadiusPoint2PropertyInfo(this);
    RadiusPoint2PropertyInfo.propertyName="RadiusPoint2";
    RadiusPoint2PropertyInfo.propertyValue=QPointF(-120,0);
    RadiusPoint2PropertyInfo.updateType = NotUpdate;
    RadiusPoint2PropertyInfo.propertyType = PointPropertyType;
    RadiusPoint2PropertyInfo.updatePropertyFun=(GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateRadiusPoint2;
    m_PropertyInfoMap.insert(RadiusPoint2PropertyInfo.propertyName,RadiusPoint2PropertyInfo);
    m_PropertyInfoMap[RadiusPoint2PropertyInfo.propertyName].setConnect();
    //是否过圆心
    GY_PropertyInfo IncludeCenterPropertyInfo(this);
    IncludeCenterPropertyInfo.propertyName="IncludeCenter";
    IncludeCenterPropertyInfo.propertyValue=true;
    IncludeCenterPropertyInfo.updateType = Update|OrdinaryAttributes;
    IncludeCenterPropertyInfo.propertyType = BoolPropertyType;
    IncludeCenterPropertyInfo.updatePropertyFun=(GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateIncludeCenter;
    m_PropertyInfoMap.insert(IncludeCenterPropertyInfo.propertyName,IncludeCenterPropertyInfo);
    m_PropertyInfoMap[IncludeCenterPropertyInfo.propertyName].setConnect();

    GY_PropertyInfo ObjectName(this);
    ObjectName.propertyName = "ObjectName";
    ObjectName.propertyValue = QString();
    ObjectName.updateType = Update|OrdinaryAttributes;
    ObjectName.propertyType = QStringPropertyType;
    ObjectName.updatePropertyFun = (GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateObjectName;
    m_PropertyInfoMap.insert("ObjectName",ObjectName);
    m_PropertyInfoMap[ObjectName.propertyName].setConnect();

    GY_PropertyInfo IsOutLined(this);
    IsOutLined.propertyName = "IsOutlined";
    IsOutLined.propertyValue = true;
    IsOutLined.updateType = Update|OrdinaryAttributes;
    IsOutLined.propertyType = BoolPropertyType;
    IsOutLined.updatePropertyFun = (GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateIsOutLined;
    m_PropertyInfoMap.insert("IsOutlined",IsOutLined);
    m_PropertyInfoMap[IsOutLined.propertyName].setConnect();

    GY_PropertyInfo IsFilled(this);
    IsFilled.propertyName = "IsFilled";
    IsFilled.propertyValue = true;
    IsFilled.updateType = Update|OrdinaryAttributes;
    IsFilled.propertyType = BoolPropertyType;
    IsFilled.updatePropertyFun = (GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateIsFilled;
    m_PropertyInfoMap.insert("IsFilled",IsFilled);
    m_PropertyInfoMap[IsFilled.propertyName].setConnect();

    GY_PropertyInfo IsOpen(this);
    IsOpen.propertyName = "IsOpen";
    IsOpen.propertyValue = false;
    IsOpen.updateType = Update|OrdinaryAttributes;
    IsOpen.propertyType = BoolPropertyType;
    IsOpen.updatePropertyFun = (GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateIsOpen;
    m_PropertyInfoMap.insert("IsOpen",IsOpen);
    m_PropertyInfoMap[IsOpen.propertyName].setConnect();

    GY_PropertyInfo IsAntialiased(this);
    IsAntialiased.propertyName = "IsAntialiased";
    IsAntialiased.propertyValue = false;
    IsAntialiased.updateType = Update|OrdinaryAttributes;
    IsAntialiased.propertyType = BoolPropertyType;
    IsAntialiased.updatePropertyFun = (GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateIsAntialiased;
    m_PropertyInfoMap.insert("IsAntialiased",IsAntialiased);
    m_PropertyInfoMap[IsAntialiased.propertyName].setConnect();

    GY_PropertyInfo FillAttributes(this);
    FillAttributes.propertyName = "FillAttributes";
    FillAttributes.propertyValue = false;
    FillAttributes.updateType = Update|OrdinaryAttributes;
    FillAttributes.propertyType = BoolPropertyType;
    FillAttributes.updatePropertyFun = (GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateFillAttributes;
    m_PropertyInfoMap.insert("FillAttributes",FillAttributes);
    m_PropertyInfoMap[FillAttributes.propertyName].setConnect();

    GY_PropertyInfo FillGradient(this);
    FillGradient.propertyName = "FillGradient";
    FillGradient.propertyValue = QVariant::fromValue(varGradientStyle);
    FillGradient.updateType = Update|OrdinaryAttributes;
    FillGradient.propertyType = FillGradientPropertyType;
    FillGradient.updatePropertyFun = (GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateFillGradient;
    m_PropertyInfoMap.insert("FillGradient",FillGradient);
    m_PropertyInfoMap[FillGradient.propertyName].setConnect();

    GY_PropertyInfo FillColor(this);
    FillColor.propertyName = "FillColor";
    FillColor.propertyValue = QColor(255,255,255);
    FillColor.updateType = Update|OrdinaryAttributes;
    FillColor.propertyType = ColorPropertyType;
    FillColor.updatePropertyFun = (GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateFillColor;
    m_PropertyInfoMap.insert("FillColor",FillColor);
    m_PropertyInfoMap[FillColor.propertyName].setConnect();

    GY_PropertyInfo FillStyle(this);
    FillStyle.propertyName = "FillStyle";
    FillStyle.propertyValue = true;
    FillStyle.updateType = Update|OrdinaryAttributes;
    FillStyle.propertyType = BoolPropertyType;
    FillStyle.updatePropertyFun = (GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateFillStyle;
    m_PropertyInfoMap.insert("FillStyle",FillStyle);
    m_PropertyInfoMap[FillStyle.propertyName].setConnect();

    GY_PropertyInfo FillOpacity(this);
    FillOpacity.propertyName = "FillOpacity";
    FillOpacity.propertyValue = 1;
    FillOpacity.updateType = Update|OrdinaryAttributes;
    FillOpacity.propertyType = QrealPropertyType;
    FillOpacity.updatePropertyFun = (GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateFillOpacity;
    m_PropertyInfoMap.insert("FillOpacity",FillOpacity);
    m_PropertyInfoMap[FillOpacity.propertyName].setConnect();

    //Pattern填充图案数据
    GY_PropertyInfo Pattern(this);
    Pattern.propertyName = "Pattern";
    Pattern.propertyValue = QVariant();
    Pattern.propertyType = PatternPropertyType;
    Pattern.updateType = Update|OrdinaryAttributes;
    Pattern.updatePropertyFun = (GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updatePattern;
    m_PropertyInfoMap.insert("Pattern",Pattern);
    m_PropertyInfoMap[Pattern.propertyName].setConnect();

    GY_PropertyInfo PenColor(this);
    PenColor.propertyName = "PenColor";
    PenColor.propertyValue = QColor();
    PenColor.updateType = Update|OrdinaryAttributes;
    PenColor.propertyType = ColorPropertyType;
    PenColor.updatePropertyFun = (GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updatePenColor;
    m_PropertyInfoMap.insert("PenColor",PenColor);
    m_PropertyInfoMap[PenColor.propertyName].setConnect();

    GY_PropertyInfo PenAttributes(this);
    PenAttributes.propertyName = "PenAttributes";
    PenAttributes.propertyValue = false;
    PenAttributes.updateType = Update|OrdinaryAttributes;
    PenAttributes.propertyType = BoolPropertyType;
    PenAttributes.updatePropertyFun = (GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updatePenAttributes;
    m_PropertyInfoMap.insert("PenAttributes",PenAttributes);
    m_PropertyInfoMap[PenAttributes.propertyName].setConnect();

    GY_PropertyInfo PenOpacity(this);
    PenOpacity.propertyName = "PenOpacity";
    PenOpacity.propertyValue = 1;
    PenOpacity.updateType = Update|OrdinaryAttributes;
    PenOpacity.propertyType = QrealPropertyType;
    PenOpacity.updatePropertyFun = (GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updatePenOpacity;
    m_PropertyInfoMap.insert("PenOpacity",PenOpacity);
    m_PropertyInfoMap[PenOpacity.propertyName].setConnect();

    GY_PropertyInfo LineStyle(this);
    LineStyle.propertyName = "LineStyle";
    LineStyle.propertyValue = QVariant();
    LineStyle.updateType = Update|OrdinaryAttributes;
    LineStyle.propertyType = LineStylePropertyType;
    LineStyle.updatePropertyFun = (GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateLineStyle;
    m_PropertyInfoMap.insert("LineStyle",LineStyle);
    m_PropertyInfoMap[LineStyle.propertyName].setConnect();

    GY_PropertyInfo IsVisible(this);
    IsVisible.propertyName = "IsVisible";
    IsVisible.propertyValue = true;
    IsVisible.updateType = Update|OrdinaryAttributes;
    IsVisible.propertyType = BoolPropertyType;
    IsVisible.updatePropertyFun = (GY_PropertyInfo::UpdatePropertyFun)&GY_GraphicsArcItem::updateIsVisible;
    m_PropertyInfoMap.insert("IsVisible",IsVisible);
    m_PropertyInfoMap[IsVisible.propertyName].setConnect();

}

void GY_GraphicsArcItem::updateDraw()
{
    QPointF centerPoint= m_PropertyInfoMap.value("Center").propertyValue.toPointF();
    qreal startAngle=m_PropertyInfoMap.value("StartAngle").propertyValue.toDouble();
    qreal sweptAngle=m_PropertyInfoMap.value("SweptAngle").propertyValue.toDouble();
    qreal Radius=m_PropertyInfoMap.value("Radius").propertyValue.toDouble();
    QPointF innerDiffPoint=QPointF(centerPoint.x()-Radius,centerPoint.y()-Radius);
    QPainterPath Path;
    if(m_PropertyInfoMap["IsOpen"].propertyValue.toBool()) {
        Path.arcMoveTo(innerDiffPoint.x(),innerDiffPoint.y(),2*Radius,2*Radius,-startAngle);
        Path.arcTo(innerDiffPoint.x(),innerDiffPoint.y(),2*Radius,2*Radius,-startAngle,-((sweptAngle)<0?(360+(sweptAngle)):(sweptAngle)));
        this->setPath(Path);
        return;
    }
    if(m_PropertyInfoMap["IncludeCenter"].propertyValue.toBool()) {
        Path.moveTo(centerPoint);
        Path.arcTo(innerDiffPoint.x(),innerDiffPoint.y(),2*Radius,2*Radius,-startAngle,-((sweptAngle)<0?(360+(sweptAngle)):(sweptAngle)));
        Path.closeSubpath();
        this->setPath(Path);
    }else {
        Path.arcMoveTo(innerDiffPoint.x(),innerDiffPoint.y(),2*Radius,2*Radius,-startAngle);
        Path.arcTo(innerDiffPoint.x(),innerDiffPoint.y(),2*Radius,2*Radius,-startAngle,-((sweptAngle)<0?(360+(sweptAngle)):(sweptAngle)));
        Path.closeSubpath();
        this->setPath(Path);
    }
}

bool GY_GraphicsArcItem::updateCirlePoint(const QString &name, const QVariant &value)
{
    if(!value.canConvert<QPointF>())
    {
        return false;
    }
    m_PropertyInfoMap[name].propertyValue=this->mapFromScene(value.toPointF());
    this->setCenterPointF(this->mapFromScene(value.toPointF()));
    calculateRadiusPoint2Position();
    calculateRadiusPoint1Position();
    updateDraw();
    return true;
}

bool GY_GraphicsArcItem::updateStartAngle(const QString &name, const QVariant &value)
{
    if(!value.canConvert<double>())
    {
        return false;
    }
    m_PropertyInfoMap[name].propertyValue=value.toDouble();
    updateDraw();
    calculateRadiusPoint2Position();
    calculateRadiusPoint1Position();
    return true;
}

bool GY_GraphicsArcItem::updateSweptAngele(const QString &name, const QVariant &value)
{
    if(!value.canConvert<double>())
    {
        return false;
    }
    m_PropertyInfoMap[name].propertyValue=value.toDouble();
    updateDraw();
    calculateRadiusPoint1Position();
    return true;
}

bool GY_GraphicsArcItem::updateRadius(const QString &name, const QVariant &value)
{
    if(!value.canConvert<double>())
    {
        return false;
    }
    m_PropertyInfoMap[name].propertyValue=value.toDouble();
    updateDraw();
    calculateRadiusPoint2Position();
    calculateRadiusPoint1Position();
    return true;
}

QPointF GY_GraphicsArcItem::precalculatedPosition(const QPointF &centerPoint, const double radius, const double angele)
{
    qreal radian=qDegreesToRadians(angele); //弧度
    QPointF resultPoint;
    resultPoint.setX(cos(radian)*radius);
    resultPoint.setY(sin(radian)*radius);
    resultPoint+=centerPoint;
    return resultPoint;
}

qreal GY_GraphicsArcItem::precalculatedAngle(const QPointF &centerPoint, const QPointF &calculatePoint)
{
    //基于圆心的偏移坐标
    QPointF diffPoint=calculatePoint-centerPoint;
    qreal pointAngle=qRadiansToDegrees(qAtan2(diffPoint.y(),diffPoint.x()));
    if(diffPoint.y()<0)
    {
        pointAngle+=360;
    }
    return pointAngle;
}

bool GY_GraphicsArcItem::updateRadiusPoint2(const QString &name, const QVariant &value)
{
    if(!value.canConvert<QPointF>())
    {
        return false;
    }
    QPointF point=this->mapFromScene(value.toPointF());
    //基于圆心的偏移坐标
    QPointF diffPoint=point-m_PropertyInfoMap.value("Center").propertyValue.toPointF();
    qreal pointRadius=qSqrt(qPow(qAbs(diffPoint.x()),2)+qPow(qAbs(diffPoint.y()),2));
    m_PropertyInfoMap["Radius"].propertyValue=pointRadius;
    qreal pointAngle=precalculatedAngle(m_PropertyInfoMap.value("Center").propertyValue.toPointF(),point);
    m_PropertyInfoMap["StartAngle"].propertyValue=pointAngle;
    calculateRadiusPoint1Position();
    updateDraw();
    m_PropertyInfoMap[name].propertyValue=point;
    this->setEditPointF(name,point);
    return true;
}

bool GY_GraphicsArcItem::updateRadiusPoint1(const QString &name, const QVariant &value)
{
    if(!value.canConvert<QPointF>())
    {
        return false;
    }
    QPointF point=this->mapFromScene(value.toPointF());
    //基于圆心的偏移坐标
    qreal pointAngle=precalculatedAngle(m_PropertyInfoMap.value("Center").propertyValue.toPointF(),point);
    m_PropertyInfoMap["SweptAngle"].propertyValue=pointAngle-m_PropertyInfoMap["StartAngle"].propertyValue.toDouble();
    calculateRadiusPoint2Position();
    QPointF  Point1=precalculatedPosition(m_PropertyInfoMap["Center"].propertyValue.toPointF(),m_PropertyInfoMap["Radius"].propertyValue.toDouble(),m_PropertyInfoMap["SweptAngle"].propertyValue.toDouble()+m_PropertyInfoMap["StartAngle"].propertyValue.toDouble());
    updateDraw();
    m_PropertyInfoMap[name].propertyValue=Point1;
    this->setEditPointF(name,Point1);
    return true;
}

bool GY_GraphicsArcItem::updateIncludeCenter(const QString &name, const QVariant &value)
{
    if(!value.canConvert<bool>())
        return false;
    m_PropertyInfoMap[name].propertyValue = value.value<bool>();
    updateDraw();
    return true;
}

void GY_GraphicsArcItem::calculateRadiusPoint2Position()
{
    QPointF RadiusPoint2=precalculatedPosition(m_PropertyInfoMap["Center"].propertyValue.toPointF(),m_PropertyInfoMap["Radius"].propertyValue.toDouble(),m_PropertyInfoMap["StartAngle"].propertyValue.toDouble());
    m_PropertyInfoMap["RadiusPoint2"].propertyValue=RadiusPoint2;
    this->setEditPointF("RadiusPoint2",RadiusPoint2);
}

void GY_GraphicsArcItem::calculateRadiusPoint1Position()
{
    QPointF RadiusPoint1=precalculatedPosition(m_PropertyInfoMap["Center"].propertyValue.toPointF(),m_PropertyInfoMap["Radius"].propertyValue.toDouble(),m_PropertyInfoMap["SweptAngle"].propertyValue.toDouble()+m_PropertyInfoMap["StartAngle"].propertyValue.toDouble());
    m_PropertyInfoMap["RadiusPoint1"].propertyValue=RadiusPoint1;
    this->setEditPointF("RadiusPoint1",RadiusPoint1);
}


